--[[
  ** 关于生成工具的声明 **

  ** 关于技能的信息 **
--]]

local _skill_val = fk.CreateSkill {
  name = "wegame_2__polang",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable {
  ["wegame_2__polang"] = "跛狼",
  [":wegame_2__polang"] = "锁定技，若你至其他角色较短路径上没有角色，则你对其使用的牌改为【兵临城下】。（至多嵌套五张）",
}

_skill_val:addEffect(fk.TargetSpecified, {
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(_skill_val.name) and (player:getNextAlive() == data.to or player:getLastAlive() == data.to) then
      return player:getMark("wegame_2__polang-phase") < 5
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:addPlayerMark(player, "wegame_2__polang-phase", 1)
    room.logic:getCurrentEvent():findParent(GameEvent.UseCard, true):addCleaner(function ()
      room:removePlayerMark(player, "wegame_2__polang-phase", 1)
    end)
    data:changeCard("enemy_at_the_gates",data.card.suit,data.card.number,_skill_val.name)
  end,
})


return _skill_val
